import { RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';

import { LearnComponent } from './learn.component';
import { InterpolationComponent } from './interpolation/interpolation.component';
import { ComponentsComponent } from './components/components.component';
import { FormsComponent } from './forms/forms.component';
import { HttpComponent } from './http/http.component';

const routes: Routes = [
  {
    path: '',
    component: LearnComponent,
    children: [
      { path: 'interpolation', component: InterpolationComponent },
      { path: 'components', component: ComponentsComponent },
      { path: 'forms', component: FormsComponent },
      { path: 'http', component: HttpComponent },
      { path: '', redirectTo: 'interpolation', pathMatch: 'full' },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class LearnRoutingModule {}
